<script setup>
 const props = defineProps({
    goodsList: {
        type: Array,        //通过type验证goodsList值类型为Array(数组)
        required: true,     //通过required属性验证goodsList为必填项
        default: []         //通过default属性验证goodsList默认值为空数组
    }
 })
</script>

<template>
<table class="table table-striped table-bordered">
    <!-- 表格标题区域 -->
    <!-- <thead>
        <tr>
            <th scope="col">#</th>
            <th scope="col">商品名称</th>
            <th scope="col">价格</th>
            <th scope="col">标签</th>
            <th scope="col">操作</th>
        </tr>
    </thead> -->
    <thead>
        <tr>
            <slot name="header"></slot>
        </tr>
    </thead>
    <!-- 表格主体区域 -->
    <tbody>
        <tr v-for="(item, index) in goodsList" :key="item.id">
        <slot name="body" :row="item" :index="index"></slot>
        </tr>
    </tbody>
</table>

</template>

<style>


</style>